import request from '@/utils/request'

// 获取所有区域及其摄像头
export function getZonesWithCameras() {
  return request({
    url: '/detect/monitor/zones',
    method: 'get'
  })
}

// 获取指定区域的摄像头
export function getCamerasByZone(zoneId) {
  return request({
    url: `/detect/monitor/zone/${zoneId}/cameras`,
    method: 'get'
  })
}

// 查询录像回放
export function queryPlayback(cameraId, date, startTime, endTime) {
  return request({
    url: '/detect/monitor/playback',
    method: 'get',
    params: {
      cameraId,
      date,
      startTime,
      endTime
    }
  })
}

// 获取摄像头状态
export function getCameraStatus(cameraId) {
  return request({
    url: `/detect/monitor/camera/${cameraId}/status`,
    method: 'get'
  })
}